package org.com.coolfish.common.database.repository;

import java.math.BigDecimal;
import java.util.List;
import org.com.coolfish.common.database.entity.KuyuAgentAccount;
import org.com.coolfish.common.database.entity.kuyuAgentCommission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface kuyuAgentCommissionRepository extends JpaRepository<kuyuAgentCommission, Integer> {
	
	@Modifying
    @Query("UPDATE kuyuAgentCommission ac SET ac.money=:money WHERE id=:id")
	void updateMoney(@Param("money") BigDecimal money,@Param("id") Integer id);
	
	@Query("SELECT new kuyuAgentCommission(ac.id, ac.money) FROM kuyuAgentCommission ac WHERE ac.aid =:aid")
	List<kuyuAgentCommission> queryeMoney(@Param("aid")Integer aid);

	
}
